<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">

<f:view>
	<h:form id="loginForm">
		<h:panelGroup rendered="#{not empty authMB.user.key}">
			<h:outputText value="#{msg['logged.in.as.text']}" />
			<br />
			<h:outputText value="#{msg.pseudonym}: #{authMB.user.pseudonym}" />
			<h:commandButton action="#{authMB.logout}" value="#{msg.logout}" styleClass="button" />
		</h:panelGroup>
		<h:panelGroup rendered="#{empty authMB.user.key}">
			<h:panelGroup>
				<fieldset class="loginFieldset">
					<h:panelGroup layout="block" id="pseudonymInput">
						<h:outputLabel value="#{msg.pseudonym}" for="pseudonym" />
						<h:inputText value="#{authMB.user.pseudonym}" id="pseudonym" />
						<h:message for="pseudonym" />
					</h:panelGroup>
					<h:panelGroup layout="block" id="passwordInput">
						<h:outputLabel value="#{msg.password}" for="password" />
						<h:inputSecret value="#{authMB.user.password}" id="password" />
						<h:message for="password" />
					</h:panelGroup>
					<h:commandButton value="#{msg.login}" action="#{authMB.login}" styleClass="button" />
					<h:commandLink value="#{msg.register}" action="#{sites.register}" styleClass="button" />
				</fieldset>
			</h:panelGroup>
		</h:panelGroup>
	</h:form>
</f:view>

</html>